﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// BMultiChildWindow 的摘要说明
/// </summary>
public class BMultiWindow
{
    public BMultiWindow()
    {
    }
    /// <summary>
    /// 多行添加业务窗体载入数据绑定
    /// </summary>
    /// <param name="gridView">GridView对象</param>
    /// <param name="sqlSelect">sql查询语句</param>
    public void PageLoadChild(ref GridView gridView, string sqlSelect)
    {
        DataSet ds = new DataSet();
        ds = RowsEdit.GetDataSet(sqlSelect);
        gridView.DataSource = ds.Tables[0].DefaultView;
        gridView.DataBind();
        ds.Dispose();
    }

    /// <summary>
    /// 多行添加业务主窗体载入事件
    /// </summary>
    /// <param name="gridView">GridView控件对象</param>
    /// <param name="ds">数据DataSet对象</param>
    /// <param name="dsView">视图DataSet对象</param>
    /// <param name="sqlDate">数据SQL查询语句</param>
    /// <param name="sqlView">数据SQL查询语句</param>
    public void PageLoadMultiPage(ref GridView gridView, ref DataSet ds, ref DataSet dsView, string sqlDate, string sqlView)
    {
        //  存放数据
        ds = RowsEdit.GetDataSet(sqlDate);
        //  存放视图
        dsView = RowsEdit.GetDataSet(sqlView);

        gridView.DataSource = dsView.Tables[0].DefaultView;
        gridView.DataBind();
        ds.Dispose();
    }
}
